package com.sumainfor.pc.market.controller.openapi;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.impl.OpenApiService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Eddy·Chen
 * @Email 835033913@qq.com
 * @Create 2019-04-20 12:52
 * 城市选择公共RestApi接口
 */
@RestController
@RequestMapping("/open/citySelect")
public class CitySelectController {

    @Autowired
    private OpenApiService apiService;

    /**
     * 获取服务中心数据 通过区的编号查询
     *
     * @param districtID
     * @return
     */
    @RequestMapping("/getServiceCenterByDistrictId")
    public JsonResult selectServiceCenterByDistrictId(String districtID) {
        if (StringUtils.isBlank(districtID)) {
            return JsonResult.errorForEmpty();
        }
        return JsonResult.success(apiService.selectServiceCenterByDistrictId(districtID));
    }
}
